@extends('admin')

@section('content')

<div class="nav">
    <ul class="cc">
        <li class="current">
            <a href="{{url('admin/order')}}">订单管理</a>
        </li>
    </ul>
</div>

<div class="h_a">搜索</div>
<div class="search_type cc mb10">
    <form action="{{url('admin/order')}}" method="get" class="search_form">
        <label for="search_buyer_mobile">买家手机：</label><input type="text" name="buyer_mobile" value="{{$buyer_mobile}}" id="search_buyer_mobile" class="input length_2 mr10"/>
        <label for="search_store_name">店铺：</label><input type="text" name="store_name" value="{{$store_name}}" id="search_store_name" class="input length_2 mr10"/>
        <label for="search_order_sn">订单号：</label><input type="text" name="order_sn" value="{{$order_sn}}" id="search_order_sn" class="input length_2 mr10"/>
        <label for="search_order_status">状态：</label>
        <select name="order_status" id="search_order_status" class=" mr10">
            <option value="100" @if ($order_status == 100) selected="selected" @endif>全部</option>
            @foreach(config('site.order_status') as $val => $txt)
            <option value="{{$val}}" @if ($order_status == $val) selected="selected" @endif>{{$txt}}</option>
            @endforeach
        </select>
        <label for="search_order_status">付款方式：</label>
        <select name="order_status" id="search_order_status" class=" mr10">
            <option value="100" @if ($order_status == 100) selected="selected" @endif>全部</option>
            @foreach(config('site.order_status') as $val => $txt)
                <option value="{{$val}}" @if ($order_status == $val) selected="selected" @endif>{{$txt}}</option>
            @endforeach
        </select>
        <button type="submit" class="btn">提交查询</button>
    </form>

</div>

<div class="table_list">
    <div id="data_list">
        <table class="items">
            <thead>
            <tr>
                <th>SN</th>
                <th>买家</th>
                <th>店铺名称</th>
                <th>订单总额 / 金币抵扣 / 实付）</th>
                <th>支付方式</th>
                <th>下单时间</th>
                <th>付款时间</th>
                {{--<th>消费时间</th>--}}
                {{--<th>退款时间</th>--}}
                <th>状态</th>
                <th>最后操作人</th>
            </tr>
            </thead>
            <tbody>
            @foreach ($list as $item)
            <tr>
                <td>{{$item->order_sn}}</td>
                <td>@if ($item->buyer) {{$item->buyer->name}} @endif</td>
                <td>@if ($item->seller && $item->seller->store) {{$item->seller->store->store_name}} @endif</td>
                <td>{{$item->amount}} / <span class="red">{{$item->pay_coin}}</span> / {{$item->money}}</td>
                <td>{{config('site.payment_type.'.$item->payment)}}</td>
                <td>{{$item->created_at}}</td>
                <td>{{$item->pay_time}}</td>
                {{--<td>{{$item->use_time}}</td>--}}
                {{--<td>{{$item->refund_time}}</td>--}}
                <td>{{config('site.order_status.'.$item->status)}}</td>
                <td>@if ($item->oper) {{$item->oper->name}} @endif</td>
            </tr>
            @endforeach
            </tbody>
        </table>
    </div>

    <div class="summary">
        共有 {{$list->total()}} 条数据
    </div>
    @if ($list->hasPages())
    <div class="pager">
        {!! $list->appends($appends)->render() !!}
    </div>
    @endif
</div>

@stop